I'm about to start writing an app, solely based on strings and string manipulation, with speed as my main priority.
With this in mind, I don't know which would be faster; C, or C++?
Opinions are appreciated.
I'm about to start writing an app, solely based on strings and string manipulation, with speed as my main priority.
With this in mind, I don't know which would be faster; C, or C++?
Opinions are appreciated.
OS: Windows XP Home Edition SP3, Windows 7 Ultimate Beta Build 7000
LANGUAGES: C++, VB6
SKILL: Novice/Intermediate
I guess you're probably right, as most C code can be compiled in a C++ compiler, that would mean it would be the same speed.
But as you sayit gets me thinking, does either language have different/faster/slower functions based on the subject of string manipulation?You merely need to know how to use the tools correctly.
Or do they both use the same functions, or are the language-specific functions slower?
OS: Windows XP Home Edition SP3, Windows 7 Ultimate Beta Build 7000
LANGUAGES: C++, VB6
SKILL: Novice/Intermediate
It all depends on the implementation, but you will probably find that std::string is no slouch in speed either, and probably simplifying a great deal of things.
The real power of C++ also lies in its templates, which when used correctly can do a lot of things at compile time.
But I would suggest that you try code, profile its speed, apply optimizations and see if the speed is sufficient.
Ok, i'll try it.
Thankyou!
OS: Windows XP Home Edition SP3, Windows 7 Ultimate Beta Build 7000
LANGUAGES: C++, VB6
SKILL: Novice/Intermediate
C and Caml (a functional language), are two of the fastest languages, with C++ just a whisker behind, with well designed programs.
I wouldn't worry about the speed of either language. Modern cpu's have more power than you can imagine, with still more to come, in the near future. Making your program multi-threaded and able to run in parallel, would be something that would really make a huge run-time difference in your program.
I was considering writing it multi thread.
I did a search on some tuts, and I found: http://www.adrianxw.dk/SoftwareSite/index.html
Which covers the basics of Win32 multi threading.
Know anywhere else I can get some tutorials?
Thanskyou!
OS: Windows XP Home Edition SP3, Windows 7 Ultimate Beta Build 7000
LANGUAGES: C++, VB6
SKILL: Novice/Intermediate